<template>
  <div>
    <van-tabs v-model="active" color="#00be88" title-active-color="#00be88">
      <van-tab title="待支付">
        <div class="pay">
          <div class="tobepaid">
            <span class="business"
              ><van-checkbox v-model="checked"></van-checkbox>
              <img src="../../assets/img/tielu.webp" alt="" class="map1" />
              <h4 class="tielu_01">12306 ></h4></span
            >
            <span class="paid">等待买家付款</span>
          </div>
          <div class="commodity">
            <div class="commodity-left">
              <img src="../../assets/img/1.jpg" alt="" />
              <span><h5>浙江-上海动车D2564 3月5日 19:51至22:40</h5></span>
            </div>
            <div class="commodity-right">
              <div class="total"><h4>￥30.5</h4></div>
              <div class="quantity">x1</div>
              <h3>需付款￥30.5</h3>
            </div>
          </div>

          <div class="payment-method">
            <button class="anniu">取消订单</button>
            <button class="anniu">找朋友付</button>
            <button class="anniu anniu3">付款</button>
          </div>
        </div>
        <van-submit-bar
          :price="3050"
          button-text="提交订单"
          @submit="onSubmit"
          button-color="#00be88"
        />
      </van-tab>
      <van-tab title="确认中">
        <van-submit-bar
          :price="3050"
          button-text="提交订单"
          @submit="onSubmit"
          button-color="#00be88"
        />
      </van-tab>
      <van-tab title="待出行">
        <van-submit-bar
          :price="3050"
          button-text="提交订单"
          @submit="onSubmit"
          button-color="#00be88"
        />
      </van-tab>
      <van-tab title="待点评">
        <van-submit-bar
          :price="3050"
          button-text="提交订单"
          @submit="onSubmit"
          button-color="#00be88"
        />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
      checked: true,
    };
  },
};
</script>

<style lang="scss" scoped>
.pay {
  background-color: white;
  margin-top: 10px;
  padding: 5px 10px;

  .tobepaid {
    display: flex;
    justify-content: space-between;

    .business {
      left: 10px;
      color: black;
      font-size: 18px;
      display: flex;
      justify-content: left;
      .map1 {
        width: 50px;
      }
      .tielu_01 {
        position: relative;
        top: 5px;
      }
    }

    .paid {
      right: 10px;
      color: red;
      font-size: 12px;
    }
  }

  .commodity {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    .commodity-left {
      display: flex;
      img {
        width: 100px;
        height: 100px;
        display: inline;
        margin-right: 8px;
      }

      span {
        width: 150px;
        h5 {
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
      }
    }
    .commodity-right {
      width: 120px;
      position: relative;
      .total {
        position: relative;
        margin-bottom: 15px;
        h4 {
          position: absolute;
          right: 0;
        }
      }
      .quantity {
        position: absolute;
        right: 0;
      }
      h3 {
        position: absolute;
        bottom: 0;
        right: 0;
        text-overflow: ellipsis;
      }
    }
  }

  .payment-method {
    display: flex;
    justify-content: right;
    margin-top: 5px;

    .anniu {
      border: 1px solid black;
      border-radius: 50px;
      margin: 10px 0 0 10px;
      font-weight: bold;
      font-size: 16px;
    }
    .anniu3 {
      border: 1px solid red;
      color: red;
    }
  }
}
</style>
